package com.crm.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.crm.dao.FinanceGeneralMapper;
import com.crm.model.FinanceGeneral;
import com.crm.service.FinanceGeneralService;
import com.crm.util.UUIDUtil;

@Service
public class FinanceGeneralServiceImpl extends BaseServiceImpl<FinanceGeneral> implements FinanceGeneralService{
	
	@Autowired
	private FinanceGeneralMapper generalMapper;

	@Override
	@Transactional
	public int insert(FinanceGeneral record) {
		
		String uuid = UUIDUtil.getUUID();
		record.setGeneralId(uuid);
		return super.insert(record);
	}

	@Override
	public FinanceGeneral getTotalIncome(FinanceGeneral t) {
		
		return generalMapper.getTotalIncome(t);
	}

	@Override
	public void deleteById(String generalId) {
		
		generalMapper.deleteById(generalId);
	}
}
